
#pragma once

using namespace System;
using namespace System::Windows;
using namespace System::Windows::Media;
using namespace System::Windows::Interop;

namespace GRIP
{
	namespace Cuda
	{
		private class InternalCudaSource
		{
		public:
			InternalCudaSource(int width, int height);
			~InternalCudaSource();
			IDirect3DSurface9* Direct3DSurface;
			cudaGraphicsResource* CudaSurfaceBridge;
			cudaArray* CudaSurfaceArray;
		};

		public ref class CudaSource : D3DImage
		{
		public:
			CudaSource(int Width, int Height);
			void Update();
			cudaArray* GetMappedArray();
			void* GetMappedArrayCrossAssembly();
			void Clear();
		private:
			int Width;
			int Height;
			Int32Rect^ Bounds;
			InternalCudaSource* InternalSource;
			IntPtr ManagedSourcePtr;
		};
	}
}

